import com.project.dao.IUser_Role;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.persistence.EntityManager;
import java.util.List;
import java.util.Map;

/**
 * @Author(王思翰)
 * @Description(类的描述)
 * @Date(创建时间) 2021/9/10 16:16
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = com.project.UserBoot.class)
public class test {
    @Autowired
    EntityManager entityManager;
    @Autowired
    IUser_Role user_role;

    @Test
    public void testOne() {
        //hq用map
        System.out.println(entityManager.createQuery("select new map(uru.name,ur.status) from User_RoleEntity ur left join ur.userEntity uru"
                + " left join ur.roleEntity urr where uru.name=?1 and ur.status=?2")
                .setParameter(1, "zhangsbnghyjmkt,lt,ky,t,vl,yyyyyyyyky,l,gyynjmkhg,yl t .ototvifbnmgmmmmmmmmmmmmmbnmg,hjk tvylmgbnmg,hjk ytvlytvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv,khhk,ygbbbbbbbbbbbbbbbbbbbbbngggvv     tfhrmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmhmhrfffffffffffffffffffffffffffffffffffffffffffrhmydbgnv thmf tvhh htvm htv,htvjyg hvtyfr,jhvtg nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnngg  mmvhtfrybnng vtmfbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbng vbbgnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnbng m             mbng bbbbbbbbmnbnm, jhgmn,bbnm bbn bmnb,mn,b bn/'.;//./.;../,;lan")
                .setParameter(2, 1)
                .getResultList());

//        //hq用dto
//        System.out.println(user_role.findAllBy());
    }
}
